<%@ taglib uri="/WEB-INF/myfaces_html.tld" 	prefix="h" %>
<%@ taglib uri="/WEB-INF/myfaces_core.tld" 	prefix="f" %>
<%@ taglib uri="/WEB-INF/tomahawk.tld"     	prefix="t" %>
<%@ taglib uri="/WEB-INF/myfaces_sandbox.tld"   prefix="s" %>
<%@ page import="java.util.ArrayList" %>

<f:view>
    <jsp:include page="/intestazione.jsp">
        <jsp:param name="titolo" value="Gestione Riepilogo"/>
    </jsp:include>
    <jsp:include page="/menu.jsp"/>
    <script language="javascript" src="./script/popup_full_center.js"></script>
    <script language="javascript" src="./script/ripristinoSessione.js"></script>
    <h:form binding="#{dettaglioRiepilogo.form}">    

        <table class="dettaglio">
            <tbody>     
                <tr>     
                    <td>
                        <h:commandLink styleClass="commandLink_Style" dir="RTL" action="benvenuto" immediate="true">
                            <t:graphicImage url="/image/go-home.png" border="0"/>
                        </h:commandLink>              
                    </td>   
                </tr>
                <tr>
                    <td class="etichettaDettaglio"><strong><t:outputLabel for="dataDa" value="Data Da:"/></strong></td>
                    <td><h:outputText value=" (gg/mm/aaaa)" style="font-size:6.5pt"/>
                        <br/>
                        <t:inputCalendar id="dataDa" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" maxlength="10" styleClass="campoTesto" value="#{beanRiepilogo.dataDa}" required="true">
                            <s:convertDateTime type="date" pattern="dd/MM/yyyy"/>
                        </t:inputCalendar>
                        <br/>
                        <h:message style="color: red; font-size: 8pt" for="dataDa" showDetail="true" showSummary="false" />
                    </td>
                </tr>
                <tr>
                    <td class="etichettaDettaglio"><strong><t:outputLabel for="dataA" value="Data A:"/></strong></td>
                    <td><h:outputText value=" (gg/mm/aaaa)" style="font-size:6.5pt"/>
                        <br/>
                        <t:inputCalendar id="dataA" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" maxlength="10" styleClass="campoTesto" value="#{beanRiepilogo.dataA}" required="true">
                            <s:convertDateTime type="date" pattern="dd/MM/yyyy"/>
                            <s:validateCompareTo operator="ge" for="dataDa" message="La prima data deve essere maggiore della seconda." />
                        </t:inputCalendar>
                        <br/>
                        <h:message style="color: red; font-size: 8pt" for="dataA" showDetail="true" showSummary="false" />
                    </td>
                    <td>
                        <t:commandButton value="Esegui" action="#{dettaglioRiepilogo.calcolaNuovoPeriodoRiepilogo}"/>                                
                    </td>     
                </tr>                                  
                
                <tr>                       
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Numero prodotti</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="prodottiDett" value="#{beanRiepilogo.prodottiDett}" styleClass="intestazionegenrale"/></strong></td>
                </tr>
                <tr>                       
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Numero clienti</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="clienti" value="#{beanRiepilogo.clienti}"/></strong></td>
                </tr>
                <tr>                       
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Numero fornitori</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="fornitori" value="#{beanRiepilogo.fornitori}"/></strong></td>                    
                </tr>
                <tr>                       
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Numero Categorie Clienti</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="catClienti" value="#{beanRiepilogo.categoriaClienti}"/></strong></td>                    
                </tr>
                <tr>                       
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Numero Categorie Fornitori</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="catFornitori" value="#{beanRiepilogo.categoriaFornitori}"/></strong></td>                    
                </tr>
                <tr>                       
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Numero Famiglie prodotti</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="famiglieProdotti" value="#{beanRiepilogo.famiglieProdotti}"/></strong></td>                    
                </tr>
                <tr>
                    <td></td><td></td><td></td>
                    <td bgcolor="#F06150" align="center"  style="font-size: 10pt;"><em><strong>Imponibile</strong></em></td>
                    <td bgcolor="#F06150" align="center"  style="font-size: 10pt;"><em><strong>Imposta</strong></em></td>
                </tr>
                
                <tr>
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Fatture di Vendita</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="fattureVendita" value="#{beanRiepilogo.fattureVendita}"/></strong></td>
                    <td bgcolor="#DBEAFB" width="30%" align="right"><strong><t:outputText id="imponibileFattura" value="#{beanRiepilogo.imponibileFattura}"> 
                            <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                        </t:outputText></strong></td>
                    <td bgcolor="#DBEAFB" width="30%" align="right"><strong><t:outputText id="ivaFattura" value="#{beanRiepilogo.ivaFattura}"> 
                            <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                        </t:outputText></strong></td>
                </tr>
                <tr>
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Scontrini</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="scontrini" value="#{beanRiepilogo.scontrini}"/></strong></td>
                    <td bgcolor="#DBEAFB" width="30%" align="right"><strong><t:outputText id="imponibileScontrino" value="#{beanRiepilogo.imponibileScontrino}"> 
                            <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                        </t:outputText></strong></td>
                    <td bgcolor="#DBEAFB" width="30%" align="right"><strong><t:outputText id="ivaScontrino" value="#{beanRiepilogo.ivaScontrino}"> 
                            <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                        </t:outputText></strong></td>
                </tr>
                <tr>
                    <td bgcolor="#FFF06F" style="font-size: 10pt;" colspan="2"><em><strong>Fatture Acquisto</strong></em></td>
                    <td bgcolor="#C1E0C0"><strong><t:outputText id="fattureAcquisto" value="#{beanRiepilogo.fattureAcquisto}"/></strong></td>
                    <td bgcolor="#DBEAFB" width="30%" align="right"><strong><t:outputText id="imponibileFattAcquisto" value="#{beanRiepilogo.imponibileFattAcquisto}"> 
                            <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                        </t:outputText></strong></td>
                    <td bgcolor="#DBEAFB" width="30%" align="right"><strong><t:outputText id="impostaFattAcquisto" value="#{beanRiepilogo.impostaFattAcquisto}"> 
                            <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                        </t:outputText></strong></td>
                </tr>
            </tbody>
        </table>
        <br />        
    </h:form> 
    
    <h:form id="erroriDataBase" rendered="false">
        <f:verbatim><table><td align="left" class="messaggiErrore" height="2px"></f:verbatim>           
        <h:messages style="color: red" showDetail="true" showSummary="false"/>
        <f:verbatim></td></table></f:verbatim>
    </h:form>  
    
    <jsp:include page="/piePagina.jsp"/>      
</f:view>